package JUnit;

import static org.junit.Assert.*;

import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import algorithm.TAN;
/**
 * @version 1.0
 * @author Jonas Untiet
 *
 */
public class LocalIPTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testlocalIP() throws UnknownHostException, SocketException {
		String localIP = InetAddress.getLocalHost().getHostAddress();
		TAN tan = TAN.getInstance();
		String t = tan.getLocalTAN();
		String IP = tan.getIPFromTan(t);
		assertEquals(localIP, IP);
		
	}
}
